/**
**************************************************************************************
*Palisma - Secrets of the Illuminati is an open-source 2D RPG                        *
*Copyright (C) 2006, Tony Sparks                                                     *
*                                                                                    *
*This library is free software; you can redistribute it and/or                       *
*modify it under the terms of the GNU Lesser General Public                          *
*License as published by the Free Software Foundation; either                        *
*version 2.1 of the License, or (at your option) any later version.                  *
*                                                                                    *
*This library is distributed in the hope that it will be useful,                     *
*but WITHOUT ANY WARRANTY; without even the implied warranty of                      *
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                   *
*Lesser General Public License for more details.                                     *
*                                                                                    *
*You should have received a copy of the GNU Lesser General Public                    *
*License along with this library; if not, write to the Free Software                 *
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA      *
**************************************************************************************
*/
#pragma once

extern "C" {
 	#include <lua.h>
 	#include <lualib.h>
 	#include <lauxlib.h>
}
#include "../game/ientity.h"

/**
========================
Enable editing and creation of entities
through LUA
========================
*/
class LUA_Entity
{
public:
    LUA_Entity(void);


    /** Create an Entity */
    static int Create( lua_State *L);
    /** Create the Player */
    static int CreatePlayer( lua_State *L);
    /** Pick a Entity */
    static int Pick( lua_State *L );

    /** Set the face of the entity */
    static int SetFace( lua_State *L );
    /** Set the name of the entity */
    static int SetName( lua_State *L );
    /** Set the state of the entity */
    static int SetState( lua_State *L );
    /** Set the position of the entity */
    static int SetPosition( lua_State *L );
    /** Set the speed */
    static int SetVelocity( lua_State *L );
    /** Add a state */
    //static int AddState( lua_State *L );

    /** Get the face of the entity */
    static int GetFace( lua_State *L );
    /** Get the name of the entity */
    static int GetName( lua_State *L );
    /** Get the position of the entity */
    static int GetPosX( lua_State *L );
     /** Get the position of the entity */
    static int GetPosY( lua_State *L );
    /** Get the speed */
    static int GetVelocityX( lua_State *L );
    /** Get the speed */
    static int GetVelocityY( lua_State *L );
    /** Get the state of the entity */
    static int GetCurrentState( lua_State *L );
    /** Give the entity an item */
    static int GiveItem( lua_State *L );

    /** Damage an entity */
    static int Damage( lua_State *L );
    static const luaL_reg methods[];

private:
    static IEntity* m_entity;
public:
    virtual ~LUA_Entity(void);
};
